<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
   xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
   xmlns:f="http://xmlns.jcp.org/jsf/core"
   xmlns:h="http://xmlns.jcp.org/jsf/html"
   xmlns:p="http://primefaces.org/ui"   
   xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"
   template="/WEB-INF/templates/default.xhtml">
   
   	<f:metadata>	   	
	   	<f:viewParam name="firstResult" value="#{agentServiceList.firstResult}"></f:viewParam>	
	   	<f:viewParam name="moduleName" value="服务事项管理"></f:viewParam>
   	</f:metadata>
   
   	<ui:define name="content">
   
		<h:form id="searchForm">
			<p:panel id="panel" style="margin-bottom:10px;">
				<f:facet name="header">服务事项管理</f:facet>
		        <p:messages id="messages" closable="true"><p:autoUpdate/></p:messages>
		        <h:panelGrid columns="2" cellpadding="5">
		        	<p:outputLabel for="name" value="服务事项名称"></p:outputLabel>
					<p:inputText
						id="name"
						value="#{agentServiceList.agentService.name}"
					></p:inputText>
				</h:panelGrid>
		    	    	
		    	<p:commandButton action="#{agentServiceList.refresh()}" update="@form" value="查询">
		    	</p:commandButton>
		    </p:panel>
		
			<p:panel id="searchResult" widgetVar="searchResult">
				<p:dataTable value="#{agentServiceList.resultList}" var="_agentService">
					
					<p:column sortBy="#{_agentService.name}" sortable="true">
						<f:facet name="header">服务事项名称</f:facet>
						#{_agentService.name}
					</p:column>
					
					<p:column sortBy="#{_agentService.qualificationClass.name}" sortable="true">
						<f:facet name="header">对应资质大类</f:facet>
						#{_agentService.qualificationClass.name}
					</p:column>
					
					<p:column style="text-align: center;width:100px;">
						<f:facet name="header">操作</f:facet>
						<h:outputLink  value="AgentServiceEdit.xhtml">
							编辑
							<f:param name="agentServiceId" value="#{_agentService.id}"></f:param>
						</h:outputLink>
					</p:column>
				</p:dataTable>
			</p:panel>
			
			<ui:include src="/WEB-INF/templates/manage/pagination.xhtml">
				<ui:param name="entityList" value="#{agentServiceList}" />
			</ui:include>
			
		</h:form>
		
		<p:button href="AgentServiceEdit.xhtml" value="新增服务事项"></p:button>
      
   	</ui:define>
</ui:composition>
